
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .parent{
            width: 300px;
            height: 300px;
            background-color: #ccc;
            /* 水平居中 */
            margin: 0 auto;
            display: flex;
            /* 弹性元素在主轴的对齐方式 默认值flex-start（left）
            flex-end 沿着主轴终点排列（文件都有）*/
            /* justify-content: flex-start;
            stretch 不可以设置高度 */
            /* justify-content: stretch; */
            /* 弹性元素在交叉轴的对齐方式 
            alligen-items;flex-start*/
            /* align-items: flex-start; */
            /* align-items: baseline;
             */align-items: stretch;
        }
        .parent>div{
            width: 60px;
            height: 60px;
        }
        .div2{
            padding-top: 10px;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="div1" style="background-color: red;">弹性元素1</div>
        <div class="div2" style="background-color: green;">弹性元素2</div>
        <div class="div3" style="background-color: blue;">弹性元素3</div> 
    </div>
</body>
</html>